import request from '@/utils/request'
declare module 'axios' {
    interface AxiosInstance {
      (config: AxiosRequestConfig): Promise<any>
    }
  }
export interface historyModel{
    cover:[],
    creator:""
    creatorBackup:{}
    momentClassificationBackup:{}
    router:""
    momentId:""
    momentTitle:""
    updateTime:number
}
export type historyListModelAll = historyListAll[]
export type historyListModel = historyModel[]

export interface historyListAll{
    content:historyModel,
    first:boolean,
    last:boolean,
    totalElements:number
    target:any

}


export default{
    getHistoryList(){
        return request.get<any,historyListModelAll>(`/moment/viewRecords?access_token=ceddaee4-94de-4a12-96e1-3e7efc5601a0&pageSize=10`)
    },
    getCollectionList(){
        return request.get(`/moment/favoriteRecords/search/findByUserId?access_token=ceddaee4-94de-4a12-96e1-3e7efc5601a0&pageSize=10&subject=activity`)
    },
    getCacheList(){
        return request.get(`/userCenter/userVideoCacheSyncs/collect/findByType?access_token=ceddaee4-94de-4a12-96e1-3e7efc5601a0&pageSize=10&type=video`)
    },
    getPracticeList(){
        return request.get(`/trainingCenter/plans/search/findByUserId?access_token=ceddaee4-94de-4a12-96e1-3e7efc5601a0&pageSize=20&pageNum=0&type=system`)
    },
    // 查询浏览记录
    gethistoryMsg(token:any,pageSize:any,pageNum:any,keyword:any){
      return  request.get(`/moment/viewRecords?access_token=${token}&pageSize=${pageSize}&pageNum=${pageNum}&keyword=${keyword}`)
    },
    getCollectionMsg(token:any,pageSize:any,pageNum:any,subject:any,keyword:any){
        return request.get(`/moment/favoriteRecords/search/findByUserId?access_token=${token}&pageSize=${pageSize}&subject${subject}&pageNum=${pageNum}&keyword=${keyword}`)
        
    },
    getCacheMsg(token:any,type:any,pageNum:any,keyword:any){
        return request.get(`/userCenter/userVideoCacheSyncs/collect/findByType?access_token=${token}&pageNum=${pageNum}&type=${type}&keyword=${keyword}`)
    }
    // 查询浏览记录
    // gethistoryMsg(token:any,pageSize:any,pageNum:any,keyword:any){
    // //   return  request.get(`/moment/viewRecords?access_token=${token}&pageSize=${pageSize}&pageNum=${pageNum}&keyword=${keyword}`)
    //    return request({
    //     url:'/moment/viewRecords',
    //     params:{
    //         access_token:token,
    //         pageNum,
    //         pageSize,

    //     }
    //    }) 
    }
   
   

